//
//  JQFYSpecialHeader.m
//  JQFY
//
//  Created by 代辉 on 2017/11/14.
//  Copyright © 2017年 yannis. All rights reserved.
//

#import "JQFYSpecialHeader.h"

@implementation JQFYSpecialHeader {
    UIButton *_moneyButton;
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        UILabel *nameLabel = [UILabel new];
        [self addSubview:nameLabel];
        nameLabel.text = @"歌曲列表";
        [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.left.equalTo(self).offset(10 *SCAL);
        }];
        
        _moneyButton = [UIButton new];
        [_moneyButton setTitle:@"¥9.9" forState:UIControlStateNormal];
        [_moneyButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [_moneyButton setBackgroundImage:[UIImage imageNamed:@"总价"] forState:UIControlStateNormal];
        _moneyButton.titleLabel.font = [UIFont systemFontOfSize:15];
        _moneyButton.adjustsImageWhenHighlighted = NO;
        [self addSubview:_moneyButton];
        [_moneyButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.right.equalTo(self).offset(-20 *SCAL);
            make.width.mas_equalTo(60 *SCAL);
            make.height.mas_equalTo(30 *SCAL);
        }];
        
    }
    return self;
}

@end
